import utime as time
import audio 
import uos



def speaker_play():
    print('------------------------Audio play start--------------------')
    time.sleep(2)
    #实例化
    aud=audio.Audio()
    #开启使能
    aud.set_pa()
    #设置音量
    aud.setVolume(1)    
    #填入路径，播放音频，工程文件夹下的音频路径为'/luadb/xxx.mp3'
    aud.play('/luadb/helloworld.mp3')
    print('------------------------Audio play done--------------------')


if __name__ == '__main__': 
    list_json = uos.listdir("/luadb/")
    print(list_json)
    speaker_play()
    time.sleep(2)
    print("------------test audio")

